<style type="text/css" title="currentStyle">
			@import "css/demo_page.css";
			@import "css/jquery.dataTables.css";
		</style>
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script>
		<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('#example').dataTable();
			} );
		</script>
<div id="tabs" >		
<div id="container">
			
			<div id="demo">
			
			<?php
			$sql="SELECT tab1.name as product,tab2.name as subproduct,tab1.year as year,tab1.series as series,tab1.title as title,tab1.original_price as original_price,tab1.offered_price as offered_price,tab1.is_new as is_new,tab1.id as id FROM
				(SELECT p.name as name,pv.year as year,pv.series as series,pv.title as title,pv.original_price as original_price,pv.offered_price as offered_price,pv.is_new as is_new,pv.id as id FROM tbl_products p
				INNER JOIN tbl_products_vehicle pv
				ON pv.productid=p.id) as tab1
				INNER JOIN
				(SELECT p.name as name,pv.year as year,pv.series as series,pv.title as title,pv.original_price as original_price,pv.offered_price as offered_price,pv.is_new as is_new,pv.id as id FROM tbl_products p
				INNER JOIN tbl_products_vehicle pv
				ON pv.subproductid=p.id) as tab2
				ON tab1.id=tab2.id";
			$result=mysql_query($sql);
?>
<?php
if(count($result)>0)
{
?>
			
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example" width="100%">
	<thead>
		<tr>
			<th>Product</th>
			<th>Sub Product</th>
			<th>Year</th>
			<th>Series</th>
			<th>Title</th>
			<th>New/Pre-owned</th>
			<th>Action</th>
		</tr>
	</thead>
	<tbody>
	<?php
	
	while($row=mysql_fetch_array($result))
	{
	?>
		<tr class="odd gradeX">
			<td><a href="products.php?id=<?php echo $row["id"]; ?>"><?php echo $row["product"]; ?></a></td>
			<td class="center"><?php echo $row["subproduct"]; ?></td>
			<td class="center"><?php echo $row["year"]; ?></td>
			<td class="center"><?php echo $row["series"]; ?></td>
			<td class="center"><?php echo $row["title"]; ?></td>
			<td class="center"><?php echo $row["is_new"]; ?></td>
			<td class="center"><a href="">Featured Vehicle</a></td>
		</tr>
	<?php } ?>

	</tbody>
	
</table>
<?php }else{ ?>
No Records Found.
<?php }?>
			<div class="spacer"></div><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<strong><center><span style="color:red;">To edit just click on the name of the product</span></center></strong>
			</div>
		</div>	
		</div>